package fr.afcepf.ai89.esharing.managedbean;

import fr.afcepf.ai89.esharing.entity.Aem;
import fr.afcepf.ai89.esharing.entity.Proprietaire;
import fr.afcepf.ai89.esharing.metier.BusinessRechercheAem;
import fr.afcepf.ai89.esharing.metier.IBusinessRechercheAem;

public class AEMView {
	
	private Aem aem;
	private Proprietaire proprio;
	private String valeur;
	private String dispo;
	private IBusinessRechercheAem rechAem = new BusinessRechercheAem();
	private double etoiles;
	private String img;
	
	public double getEtoiles() {
		etoiles = rechAem.getRating(aem);
		return etoiles;
	}

	public void setEtoiles(double etoiles) {
		this.etoiles = etoiles;
	}

	public Aem getAem() {
		return aem;
	}
	
	public void setAem(Aem aem) {
		this.aem = aem;
	}
	
	public String getValeur() {
		String oldVal = rechAem.getValeur(aem);
		valeur = oldVal.replace('.', ',');
		return valeur;
	}
	
	public void setValeur(String valeur) {
		this.valeur = valeur;
	}
	
	public String getDispo() {
		
		dispo = rechAem.getStatut(aem);
		return dispo;
		
	}
	
	public void setDispo(String dispo) {
		this.dispo = dispo;
	}

	public String getImg() {
		
		img = rechAem.getImage(aem);
		//System.out.println("img");
		return img;
		
	}

	public void setImg(String img) {
		this.img = img;
	}
	
}
